﻿@model IEnumerable<NewRen.Models.ViewModel.vMessageBoard>
@using NewRen.Models;
@using NewRen.Models.ViewModel
@{
    vUser user = ViewBag.user as vUser;
    var showname = user.RealName == null ? user.UserName : user.RealName;
    ViewBag.Title = "牛人展示-" + showname;
}

<div class="container_10 box-bg">
    <div class="personal-header top20">
        <input value="@ViewBag.SID" type="hidden" id="sid" />
        <div class="left">
            @if (user.Picture == null)
            {
                <img src="/Images/userphoto.png" width="150" height="170"
                     alt=@user.UserName />
            }
            else
            {
                <img src="/User/ShowPicture/@user.ID" width="150"
                     alt=@user.UserName height="170" />
            }
        </div>
        <div class="personal-name left" style="margin-left:20px;">
            <h1>
                @user.UserName
                @if (ViewBag.CurrentUser == null || ViewBag.IsCollected == false)
                {
                    <small>
                        <a href="javascript:addUserCollect(@user.ID,'@ViewBag.SID')"
                           class="attention" id="btnCollectUser">收藏</a>
                    </small>
                }
                else
                {
                    <small>
                        <a href="javascript:cancelUserCollect(@user.ID,'@ViewBag.SID')"
                           class="noattention" id="btnCollectUser">取消收藏</a>
                    </small>
                }

            </h1>
            <h2>@user.RealName</h2>
            @if (user.IsVerified)
            {
                <span class="show_verified_true">已认证</span>
            }
            else
            {
                <span class="show_verified_false">未认证</span>
            }
        </div>
        <div class="right right-3">
            <ul>
                <li>电话：@user.Phone</li>
                <li>QQ：@user.QQ</li>
                <li>Email：@user.Email</li>
                <li>地址：@user.Address</li>
            </ul>
        </div>
        <div class="clr"></div>
    </div>
    <div class="top-border-yellow-1 personal-info">
        <h3>个人描述</h3>
        <div class="top10">
            @if (user.Description != null)
            {
                @user.Description
            }
            else
            {
                <span style="color:#FF9933;">这个人很懒,什么都没有留下</span>
            }
        </div>
    </div>
    <div class="top-border-yellow-1 personal-info">
        <h3>基本信息</h3>
        <div class="top10">
            <table>
                <tr>
                    <td class="rc1">性别</td>
                    <td>@user.Sex</td>
                </tr>
                <tr>
                    <td class="rc1">出生日期</td>
                    <td>
                        @(user.Birthday.HasValue ? user.Birthday.Value.ToShortDateString() : "")

                    </td>
                </tr>
                <tr>
                    <td class="rc1">城市 - 区 - 镇</td>
                    <td>@user.City / @user.District / @user.Town</td>
                </tr>
                <tr>
                    <td class="rc1">职业</td>
                    <td colspan="2">@user.Job</td>
                </tr>
                <tr>
                    <td class="rc1">微博</td>
                    <td colspan="2">@user.Weibo</td>
                </tr>
                <tr>
                    <td class="rc1">微信</td>
                    <td colspan="2">@user.WhatApp</td>
                </tr>
                <tr>
                    <td class="rc1">注册时间</td>
                    <td colspan="2">@user.AddTime</td>
                </tr>
                <tr>
                    <td class="rc1">牛棚</td>
                    <td colspan="2">
                        @if (user.UserGroupID.HasValue)
                        {
                            <a href="/UserGroup/UserGroupShow/@user.UserGroupID">@user.GroupName</a>
                        }
                        else
                        {
                            <span>无</span>
                        }

                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="top-border-yellow-1 personal-data">
        <h3>数据信息</h3>
        <div class="top10">
            <span class="pv_show">总浏览量：@user.PV</span>
            <span class="pv_show" style="border:0">今日浏览：@user.TodayPV</span>
            <span id="like" class="right">
                <label onclick="like(@user.ID,'@ViewBag.SID')" class="show_item">
                    <i class="icon-feed icon-feed-up"></i>
                    （<strong id="up">@user.Ups</strong>）
                </label>
            </span>
            <span id="hate" class="right">
                <label onclick="hate(@user.ID,'@ViewBag.SID')" class="show_item">
                    <i class="icon-feed icon-feed-down"></i>
                    （<strong id="down">@user.Downs</strong>）
                </label>
            </span>
        </div>
    </div>
    <div class="top-border-yellow-1 ">
        <h3 class="personal-comment">评价</h3>

        <div>
            <input type="hidden" name="name" id="cuserId" value="@((ViewBag.CurrentUser!=null &&

ViewBag.CurrentUser.UserType==UserType.User)?ViewBag.CurrentUser.ID:"")" />
            <input type="hidden" id="userid" value="@user.ID">
            <script id="container" type="text/plain">
            </script>
            <input type="button" style="float:right" id="btnSubmit" value="提交" class="button

yellow w-1 h-s-4" onclick="MessageSubmit();" />

            <!-- 配置文件 -->
            <script type="text/javascript"
                    src="../../Scripts/ueditor/ueditor.config.js"></script>
            <!-- 编辑器源码文件 -->
            <script type="text/javascript" src="../../Scripts/ueditor/ueditor.all.js"></script>
            <!-- 实例化编辑器 -->
            <script type="text/javascript">
                var ue = UE.getEditor('container');
            </script>
        </div>
        <div class="top50 personal-comment" id="reply">
            @if (Model.Count() != 0)
            {
                foreach (var item in Model)
                {
                    <div class="msg_div">
                        <div class="height_auto top10">
                            <div class="reply-user left-2">
                                <div>
                                    <a href="/User/PersonalShow/@item.FromUser.ID">@item.FromUser.UserName</a>
                                </div>
                                @if (@item.FromUser.Picture == null)
                                {
                                    <div>
                                        <img src="/Images/userphoto.png" class="des_img"
                                             alt="@item.FromUser.UserName" />
                                    </div>
                                }
                                else
                                {
                                    <div>
                                        <img src="/User/ShowPicture/@item.FromUser.ID"
                                             class="des_img"
                                             alt="@item.FromUser.UserName" />
                                    </div>
                                }
                            </div>
                            <div class="reply-info left-2">
                                <div class="head">发表于： @item.Time</div>
                                <div class="content">@Html.Sanitized(@item.Description)</div>
                            </div>
                            <div class="clr"></div>
                        </div>
                    </div>
                }
                @Html.MakePager()
            }
            else
            {
                <div id="wu">暂无评论~</div>
            }
        </div>
    </div>
</div>